GSP-006 Monitoring Cloud Infrastructure with
Stackdriver
2017년 10월 23일 월요일
오전 9:40
링크: https://qwiklabs.com/focuses/6476
Stackdriver Monitoring는
- Dashboard, Alert 제공
- 클라우드 서비스, VM, 오픈소스 서버들(MongoDB, Apache, Nginx,
Elasticsearch 등등) 의 Performance
mecrics 볼 수 있음
- Stackdriver Monitoring Console 을 이용해 설정가능
- Stackdriver Monitoring 을 enable
- Google Stackdriver Monitoring 컨셉을 연습으로 익혀보기
- Stackdriver Monitoring 을 둘러보기
* 예전에 빅쿼리 로딩
작업의 히스토리가
- 웹콘솔을 통해 로딩하면
보이는데, bq CLI로 로딩하면 안보였던 이슈가 있었는데
- 누군가가 Stackdriver 로도 안보이냐고 물어봤었다.

모니터할 리소스부터
만들어보자
1) VM instance
2) Cloud SQL instance
- 많이 만들어보았음.
- 웹콘솔에서 Compute Engine 가서 그냥 만들면 됨. 끝
|
|
|
생성확인
|
- 웹콘솔에서 SQL 가서 그냥 만들면 됨. 끝
|
|
|
|
|
|
생성확인

- 어라~ 30일만 무료사용 가능?
- AWS도 모니터링 할
수 있다.
|
|
|
|
모니터링, 로깅 agent를
설치하면 좋다고 한다. - Google Cloud Shell 이나 SDK를 깐 local PC에 설치하면 될듯 - 이 랩에서는 일단 스킵해도 된다
|
|
일단 딱 VM 과 SQL이 보인다

* 현재는 텅텅 비어있음
- 다른 코드랩에서 setup 해주고 좀 더 볼 예정임
|
웹페이지, 인스턴스, 리소스
그룹의 건강상태를 빠르게 검증해준다. 각각의 check 설정은 전세계 다양한 위치에서 정기적으로
접촉된다 Uptime check 는 Alert policy에서의
컨디션으로 사용될 수 있다. |
|
|
|
Alerting policy를
적용해서 문제발생을 알아채자
- Stackdriver에서
제공하는 다양한 metrics 와 health check를
이용하여 policy에 이용하자
1) Alert policy에
걸리면 Incident 가 생성되며
2) 이것은 Incident 섹션에서 볼 수 있다
3) Incident 를
처리하고 나서 Closed 처리할 수 있다.
* 여기서는 Incident 를 따로 다루진 않을거다
|
|
|
프로젝트에서
발생한 이벤트들이 쌓인다
- 서버가 생성되었다.
- 서버가 restart 되었다
- 나만의 메시지를 이벤트로
추가할 수 있다.
그냥 로그
함 봄

![Google Cloud Platform
Stackdriver
Logging
Logs
Logs-based metrics
Exports
Resource usage
qwiklabs-gcp4df3f61fb1 •
CREATE METRIC
CREATE EXPORT
; You have 30 days left in your Stackdriver Premium trial. We will enforce a 7-clay retention for logs In the Basic Tier. Please upgrade to the Premium Tier to keep your logs with 30-d
Filter by label or text search
Cloud SQL Database, qwiklabs-gcp-4dt3t61t_
2017-10-23 JS
All logs
Any log level
Jump to date
la: 51: ee .669
2017-le-23Ta1 : 51 : ea. 6691562
la: 51 : ee. 669
2017-le-23Ta1 : 51 : ea. 6698562
la: 51: ee .721
2017-1e-23Ta1 : 51 : ea. 7211842
la: 51 ee. 722
2017-le-23Ta1 : 51 : ea.
la: 51: ee .726
2017-le-23Ta1 : 51 : ea.
la: 51 :ee. 726
2017-le-23Ta1 : 51 : ea. 7250832
la: 51 .758
2017-le-23Ta1 : 51 : ea. 7580122
la: 51 ee. 766
2017-le-23Ta1 : 51 : ea. 7664772
la: 51 .767
2017-1e-23Ta1 : 51 : ea. 7665782
la: 51 ee. 769
2017-le-23Ta1 : 51 : ea. 7691692
la: 51 .77a
2017-le-23Ta1 : 51 : ea. 7701322
la: 51: ee .77a
2017-le-23Ta1 : 51 : ea. 7702352
la: 51: ee. 771
2017-le-23Ta1 : 51 : ea.
la: 51: ee .771
2017-1e-23Ta1 : 51 : ea. 7711742
la: 51: ee. 771
2017-le-23Ta1 : 51 : ea. 7711872
la: 51: ee .771
2017-le-23Ta1 : 51 : ea. 7711982
la: 51: ee. 775
2017-le-23Ta1 : 51 : ea.
e [Note]
e [Note]
e [Note]
e [Note]
e [Note]
e [Note]
e [Note]
e [Note]
e [Note]
e [Note]
InnoDB :
InnoDB :
InnoDB :
InnoDB :
32 non-redo rollback segment(s) are active.
Waiting for purge to start
5.7.14 started; log sequence number 113749864
Loading buffer pool(s) from
Semi-sync replication initialized for transactions.
Semi-sync replication enabled on the master .
Starting ack receiver thread
Found gtids in binlog:
Found gtids purged from binlog:
Skipping generation of SSL certificates as options related to SSL are specified.
e [Idarning] CA certificate . pem is self signed.
e [Note] Skipping generation of RSA key pair as key files are present in data directory .
e [Note] Server hostname (bind-address)
e [Note] IPv6 is available.
port: 33136
e [Note]
resolves to
e [Note] Server socket created on IR: '
e [Idarning] ' user' entry 'root@locelhost'
ignored in
- -skip-name-resolve mode.](GSP-006%20Monitoring%20Cloud%20Infrastructure%20with%20Stackdriver.files/image036.jpg)
오른편에는
다양한 그래프와 차트를 제공한다
Stackdriver 에서 Resource > instances 에서 원하는 Compute
Engine VM instance를 선택
- Uptime Chekcs
- Event Log
- Ip Addresses, Launch time, Volume 등등
- Graph - CPU Usage, Disk I/O, Network Traffic
|
|
|

Resource > Cloud SQL
Inventory (목록) 에서 원하는 DB 선택
- Incident
- Event Log
- Settings, IP Configuration, Backup Configuration

Microsoft OneNote 2016에서 작성